package com.example.demo.controller;

import com.example.demo.service.TestService;
import com.example.demo.test.MyBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.locks.ReentrantLock;


@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestService testService;

    @Autowired
    private MyBean myBean;

    @GetMapping("/xxx")
    public String xxx(){
        TestService testService = (TestService)myBean.getMyBean("TestServiceName");
        testService.publicMethod();
        final ReentrantLock reentrantLock = new ReentrantLock();


        return null;
    }
}
